<script>
	import conf from '@/common/conf.js';
	export default {
		globalData: {
			run: "pro",
			ver: "1.0.0",
			host: null,
			auth: null,
			cos: null,
			env: 'release', // "trial: 体验版" | "release： 正式版",
			osName: 'windows', //ios、android、windows、mac、linux、harmonyos
			osVer: '10',
			appVer: '1.0.0',
			appName: '悦玺云商',
			toLeft: 320
		},
		onLaunch: function() {
			console.log('App Launch')
			this.globalData.cos = conf.pics;
			this.globalData.ver = conf.version;
			this.globalData.host = conf.host;

			let run = uni.getSystemInfoSync()
			this.globalData.osName = run.osName ?? 'windows'
			this.globalData.osVer = run.osVersion ?? ''
			this.globalData.appVer = run.appVersion ?? '1.0.0'
			if (process.env.NODE_ENV === 'development') {
				console.log('开发环境');
				this.globalData.run = 'dev';
				this.globalData.host = conf.dev_host;
			}

			let key = this.globalData.env + '_login'
			// 自动登录
			try {
				let proof = uni.getStorageSync(key);
				if (proof) {
					this.globalData.auth = proof;
					uni.reLaunch({
						url: '/pages/index/index'
					});
				}
			} catch (e) {
				//TODO handle the exception
			}

		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

<style>
	/*每个页面公共css */
	@font-face {
		font-family: "AiDianFengYaHe";
		src: url("/static/AiDianFengYaHe-2.ttf") format("truetype");
		font-weight: normal;
		font-style: normal;
	}


	.gl-font-title {
		font-family: "AiDianFengYaHe", sans-serif;
	}

	/*每个页面公共css */
	.gl-container {
		margin: 10px;
		padding: 10px;
		background-color: #fff;
		border-radius: 4px;
		box-sizing: border-box;
		pointer-events: auto;
	}

	.gl-header {
		padding: 5px 0;
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		align-items: center;
	}

	.gl-header-left,
	.gl-header-right {
		display: flex;
		flex-direction: row;
		align-items: center;
		gap: 5px;
	}

	.gl-footer {
		padding: 10px 0;
		display: flex;
		justify-content: end;
		align-items: center;
	}

	/* 按钮样式 */
	.gl-button {
		padding: 5px 10px;
		border-radius: 4px;
		display: flex;
		flex-direction: row;
		justify-content: center;
		align-items: center;
		gap: 3px;
	}

	.gl-button:hover {
		opacity: 0.8;
		transform: scale(0.98);
	}

	.gl-button-default {
		color: #fff;
		background-color: #b4b4b4;
		border: 1px solid #555555;
	}

	.gl-button-base {
		color: #fff;
		background-color: #007aff;
		border: 1px solid #01468f;
	}

	.gl-button-success {
		color: #fff;
		background-color: #4cd964;
		border: 1px solid #379c48;
	}

	.gl-button-warning {
		color: #fff;
		background-color: #f0ad4e;
		border: 1px solid #ad7d39;
	}


	.gl-button-error {
		color: #fff;
		background-color: #dd524d;
		border: 1px solid #943734;
	}

	.gl-button-other {
		color: #fff;
		background-color: #892fe8;
		border: 1px solid #6e26ba;
	}

	.gl-link {
		font-size: small;
	}

	.gl-link-base {
		color: #007aff;
	}

	.gl-link-success {
		color: #4cd964;
	}

	.gl-link-warning {
		color: #f0ad4e;
	}

	.gl-link-error {
		color: #dd524d;
	}

	.gl-link-other {
		color: #892fe8;
	}

	.gl-popup-view {
		background-color: #fff;
		border-radius: 10px;
		padding: 10px;
		font-size: small;
		display: flex;
		flex-direction: column;
	}

	.gl-popup-title,
	.gl-popup-body,
	.gl-popup-foot {
		padding: 10px;
	}

	.gl-popup-title {
		font-weight: bold;
		border-bottom: 2px solid #333;
		display: flex;
		justify-content: space-between;
		align-items: center;
	}

	.gl-button-mini {
		padding: 2px;
		border-radius: 5px;
	}

	.gl-button-mini:hover {
		opacity: 0.8;
		transform: scale(0.98);
	}

	.value-box {
		border-top: none;
		border-right: none;
		border-bottom: 1px solid #aaa;
		border-left: none;
	}


	.gl-label-text {
		font-size: 14px;
		font-weight: bold;
		color: #6a6a6a;
		margin: auto 0;
		margin-right: 5px;
	}

	.gl-empty-view {
		padding: 40px;
		font-size: x-large;
		display: flex;
		flex-direction: column;
		align-items: center;
	}

	.gl-title-item {
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: pre-wrap;
	}

	/* 表格垂直滚动 */
	.table-container {
		/* height: 400px; */
		overflow-y: auto;

		::v-deep .uni-table .table-head th {
			font-weight: bold;
			z-index: 2;
			background-color: #fff;
			position: -webkit-sticky;
			position: sticky;
			top: 0;
		}

		::v-deep .uni-table-scroll {
			overflow: visible;
		}
	}
</style>